<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/js/jquery.min.js"></script>
</head>
<body>
<table border="1px">
    <tr>
        <th>id</th>
        <th>名字</th>
        <th>邮箱</th>
        <th>手机号</th>
        <th>微信</th>
        <th>留言</th>
    </tr>
    <tbody id="tb"></tbody>
</table>
<script>
    $(function () {
        showcontact();
    })
    function showcontact() {
        $.ajax({
            type:"get",
            url:"/contact/findContact",
            dataType:"json",
            success:function (contact) {
                $("#tb").empty();
                let tr="";
                for (let i = 0; i < contact.length; i++) {
                    tr+="<tr>" +
                        "<td>"+contact[i].id+"</td>" +
                        "<td>"+contact[i].sname+"</td>" +
                        "<td>"+contact[i].semail+"</td>" +
                        "<td>"+contact[i].sphone+"</td>" +
                        "<td>"+contact[i].swx+"</td>" +
                        "<td>"+contact[i].sly+"</td>" +
                        "</tr>";
                }
                $("#tb").html(tr);
            }
        })
    }
</script>
</body>
</html>